import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.GridPane;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.Button;
import javafx.geometry.Pos;
import javafx.geometry.HPos;

public class Test extends Application {
	public void start(Stage stage) {
		Label lblFirstName=new Label("First Name:");
		Label lblMiddleName=new Label("Middle Name:");
		Label lblLastName=new Label("Last Name:");
		Label lblHello=new Label("Hello");

		TextField txtFirstName=new TextField();
		TextField txtMiddleName=new TextField();
		TextField txtLastName=new TextField();

		Button btnLogin=new Button("Sign in");

		GridPane pane=new GridPane();
		pane.setAlignment(Pos.CENTER);
		pane.setHgap(10);
		pane.setVgap(20);
		pane.add(lblFirstName,0,0);
		pane.add(txtFirstName,1,0);
		pane.add(lblMiddleName,0,1);
		pane.add(txtMiddleName,1,1);
		pane.add(lblLastName,0,2);
		pane.add(txtLastName,1,2);

		pane.add(btnLogin,1,3);

		pane.add(lblHello,0,4);
		GridPane.setColumnIndex(lblHello,1);

		GridPane.setHalignment(btnLogin,HPos.RIGHT);

		Scene scene=new Scene(pane,500,300);
		
		stage.setScene(scene);
		stage.setTitle("gridpane test");
		stage.show();
	}
}
